Skip to content

Improve action inputs and version handling - #3

Merged
dceoy merged 5 commits into
mainfrom
action-improvements
Jun 29, 2026
Merged

Improve action inputs and version handling#3
dceoy merged 5 commits into
mainfrom
action-improvements

Conversation

@dceoy

@dceoy dceoy commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reorganize input fields with required before description for consistency
  • Add default values for all optional inputs
  • Add new version input to control opencode installation version
  • Fix output key from version to opencode-version
  • Improve version resolution using jq instead of grep
  • Enhance install script to pass version parameter to opencode installer

Test plan

  • Verify action.yml is valid YAML with proper input/output schema
  • Test version parameter resolution for both 'latest' and specific versions
  • Confirm output key opencode-version is accessible in workflows

🤖 Generated with Claude Code

- reorganize input fields with required before description
- add default values for all optional inputs
- add new 'version' input to control opencode installation version
- fix output key from 'version' to 'opencode-version'
- improve version resolution with jq instead of grep
- enhance install script to pass version parameter
- improve path management with tee for consistency
@opencode-agent

Copy link
Copy Markdown

The pull request improves the action by:

  1. Consistency: Reorganizing input fields so required precedes description.
  2. Robustness: Adding default values for all optional inputs (e.g., agent: build, share: 'false', version: latest).
  3. New Feature: Introducing a version input to specify a particular OpenCode installation version.
  4. Version Resolution: Using jq for more reliable version fetching from GitHub API and renaming the output key from version to opencode-version.
  5. Installer Integration: Passing the resolved version to the installation script.

Analysis of action.yml

# ... (lines 7-38)
  version:
    required: false
    description: OpenCode version to install (e.g., v1.2.3)
    default: latest
# ... (lines 43-46)
outputs:
  opencode_version:
    description: OpenCode version resolved for this run.
    value: ${{ steps.version.outputs.opencode-version }}
# ... (lines 53-64)
    - name: Get OpenCode version
      id: version
      shell: bash -euo pipefail {0}
      env:
        INPUT_VERSION: ${{ inputs.version }}
      run: |
        if [[ "${INPUT_VERSION}" == "latest" ]]; then
          OPENCODE_VERSION="$(curl -fsSL https://github.com/ghapi/repos/anomalyco/opencode/releases/latest | jq -r '.tag_name')"
        else
          OPENCODE_VERSION="${INPUT_VERSION}"
        fi
        echo "opencode-version=$(tr -d v <<< "${OPENCODE_VERSION}")" | tee -a "${GITHUB_OUTPUT}"
# ... (lines 71-78)
    - name: Install OpenCode
      if: >
        steps.cache.outputs.cache-hit != 'true'
      shell: bash -euo pipefail {0}
      env:
        OPENCODE_VERSION: ${{ steps.version.outputs.opencode-version }}
      run: >
        curl -fsSL https://opencode.ai/install | bash -s -- --version "${OPENCODE_VERSION}"

The implementation looks solid. The use of jq and tr -d v correctly handles the version string manipulation, and the Install OpenCode step correctly utilizes the new input. The output mapping to opencode_version via opencode-version is consistent with the changes.

github run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea9159bd0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread action.yml
- Update AGENTS.md with clearer project structure descriptions and testing guidelines
- Enhance README.md with improved workflow example, input/output tables, and secret documentation
- Standardize output names in action.yml from snake_case to kebab-case (opencode_version, cache_hit)
- Document the version input for resolving OpenCode CLI versions

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@dceoy dceoy self-assigned this Jun 29, 2026
@dceoy
dceoy merged commit ae4637d into main Jun 29, 2026
6 checks passed
@dceoy
dceoy deleted the action-improvements branch June 29, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant